package dcutils.cards.mtg;

// Import JDK Classes
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;

/**
* Represents all the keywords found on cards in Magic the Gathering.<br/>
* @author dca
*/
public enum Keyword implements Iterable<Keyword> {
	BOLSTER("Bolster"),
	CONVOKE("Convoke"),
	DEATHTOUCH("Deathtouch"),
	DEFENDER("Defender"),
	DOUBLE_STRIKE("Double strike"),
	ENCHANT("Enchant"),
	EQUIP("Equip"),
	EXPLOIT("Exploit"),
	FIRST_STRIKE("First strike"),
	FLASH("Flash"),
	HASTE("Haste"),
	HEXPROOF("Hexproof"),
	INDESTRUCTIBLE("Indestructible"),
	INTIMIDATE("Intimidate"),
	LANDWALK("Landwalk"),
	LIFELINK("Lifelink"),
	MORPH("Morph"),
	PROTECTION("Protection"),
	RAMPAGE("Rampage"),
	REACH("Reach"),
	SHROUD("Shroud"),
	TRAMPLE("Trample"),
	VIGILANCE("Vigilance");

	/** The name of the mana.<br/> */
	private String name;

	/**
	 * The constructor initializes the name.<br/>
	 * @param name The name of the creature type.<br/>
	 */
	private Keyword(String name) {
		this.name = name;
	} // END constructor

	/**
	 * The getter for the name of the mana.<br/>
	 * @return name The name of the mana.<br/>
	 */
	public String getName() {
		return this.name;
	} // END getName

	/**
	 * Returns an array of all enum values.<br/>
	 * @return Keyword[] An array of all enum values.<br/>
	 */
	public static Keyword[] asArray() {
		return values();
	} // END asArray

	/**
	 * Returns a list of all enum values.<br/>
	 * @return List<Keyword> A list of all enum values.<br/>
	 */
	public static List<Keyword> asList() {
		return Arrays.asList(asArray());
	} // END asList

	/**
	 * Returns an iterator over all enum values.<br/>
	 * @return Iterator<Keyword> An iterator over all enum values.<br/>
	 */
	@Override
	public Iterator<Keyword> iterator() {
		return asList().iterator();
	} // END iterator

	/**
	 * The getter for the name of the mana.<br/>
	 * @return name The name of the mana.<br/>
	 */
	@Override
	public String toString() {
		return getName();
	} // END toString
} // END enum Keyword
